package cn.iocoder.yudao.module.system.dal.mysql.erp.warehouseoutsuk;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.erp.warehouseoutsuk.vo.WarehouseOutSukPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.erp.warehouseoutsuk.WarehouseOutSukDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 出库单sku Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WarehouseOutSukMapper extends BaseMapperX<WarehouseOutSukDO> {

    default PageResult<WarehouseOutSukDO> selectPage(WarehouseOutSukPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseOutSukDO>()
                .eqIfPresent(WarehouseOutSukDO::getOutWarehouseId, reqVO.getOutWarehouseId())
                .eqIfPresent(WarehouseOutSukDO::getSku, reqVO.getSku())
                .eqIfPresent(WarehouseOutSukDO::getNum, reqVO.getNum())
                .betweenIfPresent(WarehouseOutSukDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(WarehouseOutSukDO::getLength, reqVO.getLength())
                .eqIfPresent(WarehouseOutSukDO::getWidth, reqVO.getWidth())
                .eqIfPresent(WarehouseOutSukDO::getHeight, reqVO.getHeight())
                .eqIfPresent(WarehouseOutSukDO::getWeight, reqVO.getWeight())
                .orderByDesc(WarehouseOutSukDO::getId));
    }

}